<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mutex: Mutex_v4_0</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">mutex
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__mutex__v4__0.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mutex_v4_0</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_mutex___config.html">XMutex_Config</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This typedef contains configuration information for the device.  <a href="struct_x_mutex___config.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_mutex.html">XMutex</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> driver instance data.  <a href="struct_x_mutex.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gac521c86ba5c4f2bad8f73e515897a766"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>(BaseAddress,  MutexNumber,  RegOffset)&#160;&#160;&#160;Xil_In32((BaseAddress) + XMutex_Offset(MutexNumber) + (RegOffset))</td></tr>
<tr class="memdesc:gac521c86ba5c4f2bad8f73e515897a766"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read one of the Mutex registers.  <a href="#gac521c86ba5c4f2bad8f73e515897a766">More...</a><br /></td></tr>
<tr class="separator:gac521c86ba5c4f2bad8f73e515897a766"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga33160589a1793006209e4e259ca7de35"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga33160589a1793006209e4e259ca7de35">XMutex_WriteReg</a>(BaseAddress,  MutexNumber,  RegOffset,  ValueToWrite)</td></tr>
<tr class="memdesc:ga33160589a1793006209e4e259ca7de35"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a specified value to a register of a Mutex.  <a href="#ga33160589a1793006209e4e259ca7de35">More...</a><br /></td></tr>
<tr class="separator:ga33160589a1793006209e4e259ca7de35"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacb4152fb008849bcb87006d7bd0a97a8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#gacb4152fb008849bcb87006d7bd0a97a8">XMutex_CfgInitialize</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, <a class="el" href="struct_x_mutex___config.html">XMutex_Config</a> *ConfigPtr, UINTPTR EffectiveAddress)</td></tr>
<tr class="memdesc:gacb4152fb008849bcb87006d7bd0a97a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a specific Mutex instance/driver.  <a href="#gacb4152fb008849bcb87006d7bd0a97a8">More...</a><br /></td></tr>
<tr class="separator:gacb4152fb008849bcb87006d7bd0a97a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1255fbeea64f519d8def63e542ce8703"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber)</td></tr>
<tr class="memdesc:ga1255fbeea64f519d8def63e542ce8703"><td class="mdescLeft">&#160;</td><td class="mdescRight">Locks a particular Mutex lock within a Mutex device.  <a href="#ga1255fbeea64f519d8def63e542ce8703">More...</a><br /></td></tr>
<tr class="separator:ga1255fbeea64f519d8def63e542ce8703"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf1857cffa94ba8b3bdf491f1a0096340"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#gaf1857cffa94ba8b3bdf491f1a0096340">XMutex_Trylock</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber)</td></tr>
<tr class="memdesc:gaf1857cffa94ba8b3bdf491f1a0096340"><td class="mdescLeft">&#160;</td><td class="mdescRight">Locks a particular Mutex lock within a Mutex device.  <a href="#gaf1857cffa94ba8b3bdf491f1a0096340">More...</a><br /></td></tr>
<tr class="separator:gaf1857cffa94ba8b3bdf491f1a0096340"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82790dd21650e2b03e2c0a0f69a605d3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber)</td></tr>
<tr class="memdesc:ga82790dd21650e2b03e2c0a0f69a605d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unlocks a particular Mutex lock within a Mutex device.  <a href="#ga82790dd21650e2b03e2c0a0f69a605d3">More...</a><br /></td></tr>
<tr class="separator:ga82790dd21650e2b03e2c0a0f69a605d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga37302270d3c1c86dc0bffdfc7043b902"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga37302270d3c1c86dc0bffdfc7043b902">XMutex_IsLocked</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber)</td></tr>
<tr class="memdesc:ga37302270d3c1c86dc0bffdfc7043b902"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current lock state of a Mutex lock within a Mutex device.  <a href="#ga37302270d3c1c86dc0bffdfc7043b902">More...</a><br /></td></tr>
<tr class="separator:ga37302270d3c1c86dc0bffdfc7043b902"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0fcbb23b06dc9fb716e3812696321f66"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber, u32 *Locked, u32 *Owner)</td></tr>
<tr class="memdesc:ga0fcbb23b06dc9fb716e3812696321f66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current status of a Mutex lock within a Mutex device.  <a href="#ga0fcbb23b06dc9fb716e3812696321f66">More...</a><br /></td></tr>
<tr class="separator:ga0fcbb23b06dc9fb716e3812696321f66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad7d5c5cd3b24ffee6dcc093b98c8546a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#gad7d5c5cd3b24ffee6dcc093b98c8546a">XMutex_GetUser</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber, u32 *User)</td></tr>
<tr class="memdesc:gad7d5c5cd3b24ffee6dcc093b98c8546a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the USER register of a Mutex lock within a Mutex device.  <a href="#gad7d5c5cd3b24ffee6dcc093b98c8546a">More...</a><br /></td></tr>
<tr class="separator:gad7d5c5cd3b24ffee6dcc093b98c8546a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga941e13d2534884adf4926f05bae3966e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga941e13d2534884adf4926f05bae3966e">XMutex_SetUser</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr, u8 MutexNumber, u32 User)</td></tr>
<tr class="memdesc:ga941e13d2534884adf4926f05bae3966e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the USER register of a Mutex lock within a Mutex device.  <a href="#ga941e13d2534884adf4926f05bae3966e">More...</a><br /></td></tr>
<tr class="separator:ga941e13d2534884adf4926f05bae3966e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1599a86dd180f3bd789a2fc472e9aa29"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga1599a86dd180f3bd789a2fc472e9aa29">XMutex_SelfTest</a> (<a class="el" href="struct_x_mutex.html">XMutex</a> *InstancePtr)</td></tr>
<tr class="memdesc:ga1599a86dd180f3bd789a2fc472e9aa29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Selftest a particular Mutex hardware core.  <a href="#ga1599a86dd180f3bd789a2fc472e9aa29">More...</a><br /></td></tr>
<tr class="separator:ga1599a86dd180f3bd789a2fc472e9aa29"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Register Offset Definitions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp73ef0a73b2ea2db0d81f41505805ece5"></a>Register offsets within a Mutex, there are multiple Mutexes within a single device </p>
</td></tr>
<tr class="memitem:gac717e990a2cbe85f19525c46aefc84b6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#gac717e990a2cbe85f19525c46aefc84b6">XMU_MUTEX_REG_OFFSET</a>&#160;&#160;&#160;0</td></tr>
<tr class="memdesc:gac717e990a2cbe85f19525c46aefc84b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mutex register.  <a href="#gac717e990a2cbe85f19525c46aefc84b6">More...</a><br /></td></tr>
<tr class="separator:gac717e990a2cbe85f19525c46aefc84b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7317a6291745987d25c994702005fff2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga7317a6291745987d25c994702005fff2">XMU_USER_REG_OFFSET</a>&#160;&#160;&#160;4</td></tr>
<tr class="memdesc:ga7317a6291745987d25c994702005fff2"><td class="mdescLeft">&#160;</td><td class="mdescRight">User register.  <a href="#ga7317a6291745987d25c994702005fff2">More...</a><br /></td></tr>
<tr class="separator:ga7317a6291745987d25c994702005fff2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Mutex Register Bit Definitions</h2></td></tr>
<tr class="memitem:ga086991b467a934c97022a305bb957977"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga086991b467a934c97022a305bb957977">LOCKED_BIT</a>&#160;&#160;&#160;0x00000001</td></tr>
<tr class="memdesc:ga086991b467a934c97022a305bb957977"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the Lock bit.  <a href="#ga086991b467a934c97022a305bb957977">More...</a><br /></td></tr>
<tr class="separator:ga086991b467a934c97022a305bb957977"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97587665957065c60155f02edb2d195d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#ga97587665957065c60155f02edb2d195d">OWNER_MASK</a>&#160;&#160;&#160;0x000001FE</td></tr>
<tr class="memdesc:ga97587665957065c60155f02edb2d195d"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is CPU_ID Mask.  <a href="#ga97587665957065c60155f02edb2d195d">More...</a><br /></td></tr>
<tr class="separator:ga97587665957065c60155f02edb2d195d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad3725eb84e9d09431334eecbcf66bcd1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mutex__v4__0.html#gad3725eb84e9d09431334eecbcf66bcd1">OWNER_SHIFT</a>&#160;&#160;&#160;0x00000001</td></tr>
<tr class="memdesc:gad3725eb84e9d09431334eecbcf66bcd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is CPU_ID Shift.  <a href="#gad3725eb84e9d09431334eecbcf66bcd1">More...</a><br /></td></tr>
<tr class="separator:gad3725eb84e9d09431334eecbcf66bcd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga086991b467a934c97022a305bb957977"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga086991b467a934c97022a305bb957977">&#9670;&nbsp;</a></span>LOCKED_BIT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LOCKED_BIT&#160;&#160;&#160;0x00000001</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>

<p>This is the Lock bit. </p>
<p>Set to 1 indicates that the lock is currently owned by the processor ID specified by the CPU_ID (OWNER_MASK) in this register. Set to 0 indicates that the lock is free. </p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus()</a>, <a class="el" href="group__mutex__v4__0.html#ga37302270d3c1c86dc0bffdfc7043b902">XMutex_IsLocked()</a>, <a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock()</a>, <a class="el" href="group__mutex__v4__0.html#ga1599a86dd180f3bd789a2fc472e9aa29">XMutex_SelfTest()</a>, and <a class="el" href="group__mutex__v4__0.html#gaf1857cffa94ba8b3bdf491f1a0096340">XMutex_Trylock()</a>.</p>

</div>
</div>
<a id="ga97587665957065c60155f02edb2d195d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga97587665957065c60155f02edb2d195d">&#9670;&nbsp;</a></span>OWNER_MASK</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define OWNER_MASK&#160;&#160;&#160;0x000001FE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>

<p>This is CPU_ID Mask. </p>
<p>CPU_ID indicates the ID the processor holding the lock. </p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus()</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<a id="gad3725eb84e9d09431334eecbcf66bcd1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad3725eb84e9d09431334eecbcf66bcd1">&#9670;&nbsp;</a></span>OWNER_SHIFT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define OWNER_SHIFT&#160;&#160;&#160;0x00000001</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>

<p>This is CPU_ID Shift. </p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus()</a>, <a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock()</a>, <a class="el" href="group__mutex__v4__0.html#gaf1857cffa94ba8b3bdf491f1a0096340">XMutex_Trylock()</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<a id="gac717e990a2cbe85f19525c46aefc84b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac717e990a2cbe85f19525c46aefc84b6">&#9670;&nbsp;</a></span>XMU_MUTEX_REG_OFFSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XMU_MUTEX_REG_OFFSET&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>

<p>Mutex register. </p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus()</a>, <a class="el" href="group__mutex__v4__0.html#ga37302270d3c1c86dc0bffdfc7043b902">XMutex_IsLocked()</a>, <a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock()</a>, <a class="el" href="group__mutex__v4__0.html#gaf1857cffa94ba8b3bdf491f1a0096340">XMutex_Trylock()</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<a id="ga7317a6291745987d25c994702005fff2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7317a6291745987d25c994702005fff2">&#9670;&nbsp;</a></span>XMU_USER_REG_OFFSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XMU_USER_REG_OFFSET&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>

<p>User register. </p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#gad7d5c5cd3b24ffee6dcc093b98c8546a">XMutex_GetUser()</a>, and <a class="el" href="group__mutex__v4__0.html#ga941e13d2534884adf4926f05bae3966e">XMutex_SetUser()</a>.</p>

</div>
</div>
<a id="gac521c86ba5c4f2bad8f73e515897a766"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac521c86ba5c4f2bad8f73e515897a766">&#9670;&nbsp;</a></span>XMutex_ReadReg</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XMutex_ReadReg</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">BaseAddress, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MutexNumber, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">RegOffset&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;Xil_In32((BaseAddress) + XMutex_Offset(MutexNumber) + (RegOffset))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>

<p>Read one of the Mutex registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddress</td><td>contains the base address of the Mutex device. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>contains the specific Mutex within the device, a zero based number, 0 - (NumMutexConfigured in HW - 1). </td></tr>
    <tr><td class="paramname">RegOffset</td><td>contains the offset from the 1st register of the Mutex to select the specific register of the Mutex.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The 32 bit value read from the register.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>C-style signature: u32 XMutex_ReadReg(u32 BaseAddress, u8 MutexNumber, unsigned RegOffset) </dd></dl>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus()</a>, <a class="el" href="group__mutex__v4__0.html#gad7d5c5cd3b24ffee6dcc093b98c8546a">XMutex_GetUser()</a>, <a class="el" href="group__mutex__v4__0.html#ga37302270d3c1c86dc0bffdfc7043b902">XMutex_IsLocked()</a>, <a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock()</a>, <a class="el" href="group__mutex__v4__0.html#gaf1857cffa94ba8b3bdf491f1a0096340">XMutex_Trylock()</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<a id="ga33160589a1793006209e4e259ca7de35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga33160589a1793006209e4e259ca7de35">&#9670;&nbsp;</a></span>XMutex_WriteReg</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XMutex_WriteReg</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">BaseAddress, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">MutexNumber, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">RegOffset, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ValueToWrite&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex__hw_8h.html">xmutex_hw.h</a>&gt;</code></p>
<b>Value:</b><div class="fragment"><div class="line">Xil_Out32(((BaseAddress) + XMutex_Offset(MutexNumber) +            \</div><div class="line">                        (RegOffset)), (ValueToWrite))</div></div><!-- fragment -->
<p>Write a specified value to a register of a Mutex. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">BaseAddress</td><td>is the base address of the Mutex device. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex within the device, a zero based number, 0 - (NumMutexConfigured in HW - 1). </td></tr>
    <tr><td class="paramname">RegOffset</td><td>contain the offset from the 1st register of the Mutex to select the specific register of the Mutex. </td></tr>
    <tr><td class="paramname">ValueToWrite</td><td>is the 32 bit value to be written to the register.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>C-style signature: void XMutex_WriteReg(u32 BaseAddress, u8 MutexNumber, unsigned RegOffset, u32 ValueToWrite) </dd></dl>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock()</a>, <a class="el" href="group__mutex__v4__0.html#ga941e13d2534884adf4926f05bae3966e">XMutex_SetUser()</a>, <a class="el" href="group__mutex__v4__0.html#gaf1857cffa94ba8b3bdf491f1a0096340">XMutex_Trylock()</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gacb4152fb008849bcb87006d7bd0a97a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacb4152fb008849bcb87006d7bd0a97a8">&#9670;&nbsp;</a></span>XMutex_CfgInitialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_CfgInitialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_mutex___config.html">XMutex_Config</a> *&#160;</td>
          <td class="paramname"><em>ConfigPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UINTPTR&#160;</td>
          <td class="paramname"><em>EffectiveAddress</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Initializes a specific Mutex instance/driver. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">ConfigPtr</td><td>is the device configuration structure containing required HW build data. </td></tr>
    <tr><td class="paramname">EffectiveAddress</td><td>is the Physical address of the hardware in a Virtual Memory operating system environment. It is the Base Address in a stand alone environment.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if initialization was successful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="struct_x_mutex.html#aab67818beece616d3da30ef3944681e8">XMutex::IsReady</a>, <a class="el" href="struct_x_mutex___config.html#a6a5e5f976fbe7c908f0595ee6d6ed0ee">XMutex_Config::NumMutex</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<a id="ga0fcbb23b06dc9fb716e3812696321f66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0fcbb23b06dc9fb716e3812696321f66">&#9670;&nbsp;</a></span>XMutex_GetStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XMutex_GetStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>Locked</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>Owner</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Gets the current status of a Mutex lock within a Mutex device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1). </td></tr>
    <tr><td class="paramname">Locked</td><td>is a pointer where the current lock status is stored. Sets memory pointed to by 'Locked' to 1 if the Mutex is locked and 0 if it is unlocked. </td></tr>
    <tr><td class="paramname">Owner</td><td>is a pointer where the current owner status is stored. . If the Mutex is locked, the memory pointed to by 'Owner' is updated to reflect the CPU ID that has currently locked this Mutex.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="group__mutex__v4__0.html#ga086991b467a934c97022a305bb957977">LOCKED_BIT</a>, <a class="el" href="group__mutex__v4__0.html#ga97587665957065c60155f02edb2d195d">OWNER_MASK</a>, <a class="el" href="group__mutex__v4__0.html#gad3725eb84e9d09431334eecbcf66bcd1">OWNER_SHIFT</a>, <a class="el" href="group__mutex__v4__0.html#gac717e990a2cbe85f19525c46aefc84b6">XMU_MUTEX_REG_OFFSET</a>, and <a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>.</p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga1599a86dd180f3bd789a2fc472e9aa29">XMutex_SelfTest()</a>.</p>

</div>
</div>
<a id="gad7d5c5cd3b24ffee6dcc093b98c8546a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad7d5c5cd3b24ffee6dcc093b98c8546a">&#9670;&nbsp;</a></span>XMutex_GetUser()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_GetUser </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>User</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Gets the USER register of a Mutex lock within a Mutex device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1). </td></tr>
    <tr><td class="paramname">User</td><td>is a pointer to an u32 where the current user register value is stored by this function. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful. Memory pointed to by User is updated to reflect the contents of the user register.</li>
<li>XST_NO_FEATURE if the Mutex was not configured with a USER register.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="struct_x_mutex___config.html#aee8b1e02a59b48c5b337d6701e3661ce">XMutex_Config::UserReg</a>, <a class="el" href="group__mutex__v4__0.html#ga7317a6291745987d25c994702005fff2">XMU_USER_REG_OFFSET</a>, and <a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>.</p>

</div>
</div>
<a id="ga37302270d3c1c86dc0bffdfc7043b902"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga37302270d3c1c86dc0bffdfc7043b902">&#9670;&nbsp;</a></span>XMutex_IsLocked()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_IsLocked </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Gets the current lock state of a Mutex lock within a Mutex device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>TRUE if locked</li>
<li>FALSE if unlocked</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="group__mutex__v4__0.html#ga086991b467a934c97022a305bb957977">LOCKED_BIT</a>, <a class="el" href="group__mutex__v4__0.html#gac717e990a2cbe85f19525c46aefc84b6">XMU_MUTEX_REG_OFFSET</a>, and <a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>.</p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga1599a86dd180f3bd789a2fc472e9aa29">XMutex_SelfTest()</a>.</p>

</div>
</div>
<a id="ga1255fbeea64f519d8def63e542ce8703"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1255fbeea64f519d8def63e542ce8703">&#9670;&nbsp;</a></span>XMutex_Lock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XMutex_Lock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Locks a particular Mutex lock within a Mutex device. </p>
<p>Call blocks till the Mutex is locked.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>XMutex_Trylock is a blocking call. This call blocks until the user gets the lock.</li>
<li>Use XMutex_Trylock for a Non-Blocking call. The user gets the lock if it is available and returns immediately if the lock is not available. </li>
</ul>
</dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="group__mutex__v4__0.html#ga086991b467a934c97022a305bb957977">LOCKED_BIT</a>, <a class="el" href="group__mutex__v4__0.html#gad3725eb84e9d09431334eecbcf66bcd1">OWNER_SHIFT</a>, <a class="el" href="group__mutex__v4__0.html#gac717e990a2cbe85f19525c46aefc84b6">XMU_MUTEX_REG_OFFSET</a>, <a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>, and <a class="el" href="group__mutex__v4__0.html#ga33160589a1793006209e4e259ca7de35">XMutex_WriteReg</a>.</p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#ga1599a86dd180f3bd789a2fc472e9aa29">XMutex_SelfTest()</a>.</p>

</div>
</div>
<a id="ga1599a86dd180f3bd789a2fc472e9aa29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1599a86dd180f3bd789a2fc472e9aa29">&#9670;&nbsp;</a></span>XMutex_SelfTest()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_SelfTest </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8h.html">xmutex.h</a>&gt;</code></p>

<p>Selftest a particular Mutex hardware core. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if test was successful.</li>
<li>XST_FAILURE if test was not successful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This test is destructive. It will fail if the Mutex is currently being used. This is also a blocking call, if there is another process which has the Mutex, the first _lock will hand the test until the other process releases it. </p>

<p class="reference">References <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="group__mutex__v4__0.html#ga086991b467a934c97022a305bb957977">LOCKED_BIT</a>, <a class="el" href="struct_x_mutex___config.html#a6a5e5f976fbe7c908f0595ee6d6ed0ee">XMutex_Config::NumMutex</a>, <a class="el" href="group__mutex__v4__0.html#ga0fcbb23b06dc9fb716e3812696321f66">XMutex_GetStatus()</a>, <a class="el" href="group__mutex__v4__0.html#ga37302270d3c1c86dc0bffdfc7043b902">XMutex_IsLocked()</a>, <a class="el" href="group__mutex__v4__0.html#ga1255fbeea64f519d8def63e542ce8703">XMutex_Lock()</a>, and <a class="el" href="group__mutex__v4__0.html#ga82790dd21650e2b03e2c0a0f69a605d3">XMutex_Unlock()</a>.</p>

</div>
</div>
<a id="ga941e13d2534884adf4926f05bae3966e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga941e13d2534884adf4926f05bae3966e">&#9670;&nbsp;</a></span>XMutex_SetUser()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_SetUser </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>User</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Sets the USER register of a Mutex lock within a Mutex device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1). </td></tr>
    <tr><td class="paramname">User</td><td>is the value to update the USER register with.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the USER register is written with the given value .</li>
<li>XST_NO_FEATURE if the Mutex was not configured with a USER register.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="struct_x_mutex___config.html#aee8b1e02a59b48c5b337d6701e3661ce">XMutex_Config::UserReg</a>, <a class="el" href="group__mutex__v4__0.html#ga7317a6291745987d25c994702005fff2">XMU_USER_REG_OFFSET</a>, and <a class="el" href="group__mutex__v4__0.html#ga33160589a1793006209e4e259ca7de35">XMutex_WriteReg</a>.</p>

</div>
</div>
<a id="gaf1857cffa94ba8b3bdf491f1a0096340"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf1857cffa94ba8b3bdf491f1a0096340">&#9670;&nbsp;</a></span>XMutex_Trylock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_Trylock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Locks a particular Mutex lock within a Mutex device. </p>
<p>Call returns immediately if the Mutex is already locked (This is Non-Blocking call).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if locking was successful.</li>
<li>XST_DEVICE_BUSY if the Mutex was found to be already locked</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>This is Non-Blocking call, the user gets the lock if it is available else XST_DEVICE_BUSY is returned.</li>
<li>Use XMutex_Lock if you need to block until a lock is obtained. </li>
</ul>
</dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="group__mutex__v4__0.html#ga086991b467a934c97022a305bb957977">LOCKED_BIT</a>, <a class="el" href="group__mutex__v4__0.html#gad3725eb84e9d09431334eecbcf66bcd1">OWNER_SHIFT</a>, <a class="el" href="group__mutex__v4__0.html#gac717e990a2cbe85f19525c46aefc84b6">XMU_MUTEX_REG_OFFSET</a>, <a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>, and <a class="el" href="group__mutex__v4__0.html#ga33160589a1793006209e4e259ca7de35">XMutex_WriteReg</a>.</p>

</div>
</div>
<a id="ga82790dd21650e2b03e2c0a0f69a605d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga82790dd21650e2b03e2c0a0f69a605d3">&#9670;&nbsp;</a></span>XMutex_Unlock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XMutex_Unlock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_mutex.html">XMutex</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>MutexNumber</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="xmutex_8c.html">xmutex.c</a>&gt;</code></p>

<p>Unlocks a particular Mutex lock within a Mutex device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_mutex.html" title="The XMutex driver instance data. ">XMutex</a> instance to be worked on. </td></tr>
    <tr><td class="paramname">MutexNumber</td><td>is the specific Mutex lock within the device to operate on. Each device may contain multiple Mutex locks. The Mutex number is a zero based number with a range of 0 - (InstancePtr-&gt;Config.NumMutex - 1).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><pre class="fragment">    - XST_SUCCESS if locking was successful.
    - XST_FAILURE if the Mutex was locked by process with
      different ID.
</pre></dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_mutex___config.html#a702073a45ef5b790e5c16cee5bb3a051">XMutex_Config::BaseAddress</a>, <a class="el" href="struct_x_mutex.html#a7546022d3c935b840c762b763b94b460">XMutex::Config</a>, <a class="el" href="group__mutex__v4__0.html#ga97587665957065c60155f02edb2d195d">OWNER_MASK</a>, <a class="el" href="group__mutex__v4__0.html#gad3725eb84e9d09431334eecbcf66bcd1">OWNER_SHIFT</a>, <a class="el" href="group__mutex__v4__0.html#gac717e990a2cbe85f19525c46aefc84b6">XMU_MUTEX_REG_OFFSET</a>, <a class="el" href="group__mutex__v4__0.html#gac521c86ba5c4f2bad8f73e515897a766">XMutex_ReadReg</a>, and <a class="el" href="group__mutex__v4__0.html#ga33160589a1793006209e4e259ca7de35">XMutex_WriteReg</a>.</p>

<p class="reference">Referenced by <a class="el" href="group__mutex__v4__0.html#gacb4152fb008849bcb87006d7bd0a97a8">XMutex_CfgInitialize()</a>, and <a class="el" href="group__mutex__v4__0.html#ga1599a86dd180f3bd789a2fc472e9aa29">XMutex_SelfTest()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
